import { ApiProperty } from '@nestjs/swagger'
import { IsString, MaxLength, IsDecimal, IsInt, IsArray } from 'class-validator'

export class paginationDto<T> {
  @ApiProperty()
  @IsInt()
  pageNum: number

  @ApiProperty()
  @IsInt()
  pageSize: number

  @ApiProperty()
  @IsInt()
  total: number

  @ApiProperty()
  @IsArray()
  records: Array<T>

  constructor(pageNum, pageSize, records, total) {
    this.pageNum = pageNum
    this.pageSize = pageSize
    this.records = records
    this.total = total
  }
}
